package cn.ekuma.security;

import cn.ekuma.security.bean.I_Role;
import com.openbravo.data.basic.BasicException;

public interface I_SecurityManager {
	
	void fillSecurityObject(I_SecurityObject toFillObj);

    void init(I_Role role) throws BasicException;
    
    boolean hasPermission(int permissionId);
    
    public boolean hasPermissionByName(String name);
    
    boolean hasGroupPermission(int permissionId);
    
    boolean hasePermissionByRole(I_Role role,String permission) throws BasicException;
    
    public boolean hasChildPermissionByName(String parentPermission,String childPermisson) throws BasicException;

    //********安全锁相关,
    public boolean lock(String askFor,String target, String targetId,String memo) throws BasicException;
    
    public boolean unlock(String askFor,String target, String targetId) throws BasicException;
    
    public boolean unlockAllbyAskToTarget(String askFor,String target) throws BasicException;
    
    public boolean unlockAllbyAsk(String askFor) throws BasicException;

}
